package com.sscaipiao.android.activity.Base;

import android.app.Activity;
import android.app.ProgressDialog;
import android.os.Bundle;
import com.sscaipiao.android.activity.MyApplication;
import com.sscaipiao.android.model.User;

/**
 * Created by Airay.Rong on 14-1-8.
 */
//只负责保存user变量，从application获取
public class BaseActivity extends Activity {
	protected User user;
	protected String LOTT_CODE;
	private ProgressDialog mProgressDialog = null;

	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		MyApplication appState = (MyApplication)getApplicationContext();
		user = appState.getGod();
	}

	public void showProgressDialog() {
		if (mProgressDialog != null&& mProgressDialog.isShowing()) {
			mProgressDialog.dismiss();
		}
		mProgressDialog = ProgressDialog.show(this,"", "请稍候", true, true);
		mProgressDialog.setCanceledOnTouchOutside(false);
	}

	public void closeProgressDailog() {
		if (mProgressDialog != null&& mProgressDialog.isShowing()) {
			mProgressDialog.dismiss();
		}
	}
}